﻿using System.Threading;
using MaxStoreErp.Core.BaseClasses;
using MaxStoreErp.Core.Commands;
using MaxStoreErp.Core.Interfaces;
using MaxStoreErp.Core.Ui.MainMenu;
using Microsoft.Practices.Unity;
using ModuleWithMenu.TestForm;

namespace ModuleWithMenu
{
    public class ModuleWithMenu : ModuleBase
    {
        protected override string ModuleName
        {
            get { return "Module with menu list"; }
        }

        protected override void RegisterServices()
        {
            base.RegisterServices();
            Thread.Sleep(2000);
        }

        protected override void RegisterMenuItems()
        {
            base.RegisterMenuItems();
            MainMenuService.Add(new MenuItemControl
            {
                Name = "Места",
                GroupName = "Склад",
                Command =
                    new RelayCommand(() => UnityContainer.Resolve<IDocumentManager>().NavigateTo<TestFormPresenter>())
            });
        }
    }
}
